#!/bin/bash

#
# Copyright (c) 2019-2020. TIBCO Software Inc.
# This file is subject to the license terms contained in the license file that is distributed with this file.
#

cat <<EOF
Openshift's Source-to-Image (S2I) is a framework for building reproducible container images making it super easy for developers to provide application source code as an input and produce a new image that runs the assembled application as output.

TIBCO Business Events's S2I support allows users to create a reusable builder image while the developer can provide end application source code (via ear & cdd) to create and run the assembled image.

Follow the given steps to use S2I for deploying applications:

You have already created s2ibuilder image. If not please create s2ibuilder image using build_image script. Next we provide application source to s2i to create an assembled image off the s2ibuilder image.

s2i build <location of the source code> <name of the s2ibuilder image> <name of the application image>

Using FraudDetection application for this example,
s2i build /Users/test/Applications/FraudDetection/source s2ibuilder:5.6.0 fdapps2i:01

Finally run the application,
docker run -p 8108:8108 <name of the application image created in prev step(fdapps2i:01)>

EOF
